{php include wl_template('common/header');}
<ul class="nav nav-tabs" id="myTab">
	<li class="active"><a href="#tab_basic">系统设置</a></li>
	<li><a href="#tab_listshare">列表分享</a></li>
	<li><a href="#tab_goodshare">商品分享</a></li>
</ul>
<div class="app-content">
	<div class="app-form">
		<form action="" method="post" id="setting-form" class="form-horizontal form form-validate">
			<div class="panel panel-default">
			<div class="form-group-title">系统设置</div>
			<div class="panel-body">
			<div class="tab-content">
			<div class="tab-pane active" id="tab_basic">
				<div class="form-group">
					<label class="col-sm-2 control-label">开启积分商城</label>
					<div class="col-sm-9">
						<div class="radio radio-success radio-inline">
							<input type="radio" id="inlineRadio1" name="set[status]" value="1" {if intval($settings['status']) == 1}checked="checked"{/if}>
							<label for="inlineRadio1"> 开启 </label>
						</div>
						<div class="radio radio-success radio-inline">
							<input type="radio" id="inlineRadio2" name="set[status]" value="0" {if intval($settings['status']) == 0 || empty($settings['status'])}checked="checked"{/if}>
							<label for="inlineRadio2"> 关闭 </label>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">积分商城类型</label>
					<div class="col-sm-9">
						<div class="radio radio-success radio-inline" onclick="$('#otherurl').hide();">
							<input type="radio" id="inlineRadio3" name="set[type]" value="0" {if intval($settings['type']) == 0 || empty($settings['type'])}checked="checked"{/if}>
							<label for="inlineRadio3"> 本系统 </label>
						</div>
						<div class="radio radio-success radio-inline" onclick="$('#otherurl').show();">
							<input type="radio" id="inlineRadio4" name="set[type]" value="1" {if intval($settings['type']) == 1}checked="checked"{/if}>
							<label for="inlineRadio4"> 其他 </label>
						</div>
					</div>
				</div>
				<div id="otherurl" {if empty($settings['type'])}style="display: none;"{/if}>
					<div class="form-group">
						<label class="col-sm-2 control-label">积分商城链接</label>
						<div class="col-sm-9">
							<input type="text" name="set[otherurl]" class="form-control" value="{$settings['otherurl']}"/>
							<span class="help-block">请输入其他积分商城链接</span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-7 col-sm-3 col-md-2 control-label">社群</label>
					<div class="col-sm-7 col-xs-6">
						<select name="set[community]" class="form-control select2 col-sm-7 col-xs-6">
							<option value="-1" >不显示社群</option>
							{loop $comList $item}
								<option value="{$item['id']}" {if $item['id'] == $settings['community']} selected="selected" {/if}>{$item['communname']}</option>
							{/loop}
						</select>
					</div>
				</div>
			</div>
			<div class="tab-pane" id="tab_listshare">
				<div class="alert alert-info">
					<b>适用模板变量：[昵称] [时间] [系统名称]</b>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">分享标题</label>
					<div class="col-sm-8">
						<input type="text" name="set[share_title]" class="form-control" value="{$settings['share_title']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">分享图片</label>
					<div class="col-sm-8">
						{php echo attachment_select('set[share_image]', $settings['share_image']);}
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">分享描述</label>
					<div class="col-sm-8">
						<input type="text" name="set[share_desc]" class="form-control" value="{$settings['share_desc']}" />
					</div>
				</div>
			</div>
			<div class="tab-pane" id="tab_goodshare">
				<div class="alert alert-info">
					<b>适用模板变量：[商品名称] [原价] [所需积分] [所需金额] [昵称] [时间] [系统名称]</b>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">分享标题</label>
					<div class="col-sm-8">
						<input type="text" name="set[goods_title]" class="form-control" value="{$settings['goods_title']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">分享图片</label>
					<div class="col-sm-8">
						{php echo attachment_select('set[goods_image]', $settings['goods_image']);}
						<span class="help-block">不上传默认使用商品图片</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">分享描述</label>
					<div class="col-sm-8">
						<input type="text" name="set[goods_desc]" class="form-control" value="{$settings['goods_desc']}" />
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-9">
					<input type="submit" name="submit" lay-submit value="提交" class="btn btn-primary min-width" />
					<input type="hidden" name="token" value="{$_W['token']}" />
				</div>
			</div>
			</div>
			</div>
			</div>
		</form>
	</div>
</div>
<script>
$(function () {
		window.optionchanged = false;
		$('#myTab a').click(function (e) {
			e.preventDefault();//阻止a链接的跳转行为
			$(this).tab('show');//显示当前选中的链接及关联的content
		})
	});
</script>	
{php include wl_template('common/footer');}